var get_upload_url =function(){
    if (process.env.VUE_APP_DEBUG) {
      return process.env.VUE_APP_BASE_API
    }else{
      return window.location.protocol + '//' + window.location.host+'/';
    }
} 


const model_hide_list={
    //页首
    head:{title:'标题栏',img:'el-icon-zoom-in',nomargin:1,
    data:[
        {title:'页首标题',field:'title',type:'input'},
        {title:'页首标题颜色',field:'title_color',type:'color'},
        {title:'页首背景颜色',field:'bg',type:'color',},
        {title:'字体大小',field:'title_size',type:'slider',min:8,max:40,nofloat:1},
        {title:'页面前景颜色',field:'background',type:'colorArr'},
        {title:'页面前景大小',field:'background_size',type:'slider',min:0,max:300,nofloat:1},
        {title:'页面背景颜色',field:'end_bg',type:'color'},
        {title:'背景颜色或图片',field:'is_thumb',type:'select',list:['颜色','图片','轮播'],nofloat:1},
        {title:'设置图片',field:'thumb',type:'thumb',condition:['is_thumb','1'],width:"100",nofloat:1,height_field:"background_size"},
        {title:'设置轮播图',field:'banner',type:'banner',condition:['is_thumb','2'],width:"100",nofloat:1,height_field:"background_size"},
    ],
    def:{type:'head',data:{
        bg:'#039dff',//头部背景颜色
        title:'首页',//标题
        title_color:'#ffffff',//标题文字颜色
        title_size:16,//标题文字大小
        banner:[],//判断是否用图片
        thumb:'',
        is_thumb:0,
        background_size:125,
        background:['#014aff','#039dff'],//渐变背景颜色
        end_bg:'#f0f0f0',//渐变背景颜色
        },},
    },
    bottom:{title:'首页导航',type:'bottom',
    data:[
        {title:'文字颜色',field:'title_color',type:'color',},
        {title:'选中颜色',field:'check_color',type:'color',},
        {title:'高度',field:'hight',type:'slider',min:30,max:80,nofloat:1},
        {title:'上下内边距',field:'bottom_padding_h',type:'slider',min:0,max:80,nofloat:1},
        {title:'文字上边距',field:'title_top',type:'slider',min:0,max:80,nofloat:1},
        {title:'文字大小',field:'title_size',type:'slider',min:8,max:50,nofloat:1},
        {title:'图标大小',field:'icon_size',type:'slider',min:8,max:50,nofloat:1,},
        {title:'大图标圆角',field:'img_radius',type:'slider',min:0,max:50,nofloat:1,},
        {title:'设置',field:'list',type:'bottom',},
      ],
    def:{type:'bottom',data:{
        title_color:'#999999',
        check_color:'#ff0000',
        title_size:12,
        icon_size:30,
        bottom_padding_h:7,
        hight:55,
        title_top:3,
        list:[
            {big:false,title:'首页',icon:'iconfont icon-icon_huabanfuben',path:'index',is_thumb:0},
            {big:false,title:'分类',icon:'iconfont icon-integral',path:'classfiy',is_thumb:0},
            {big:false,title:'购物车',icon:'iconfont icon-cart-Empty',path:'shopcar',is_thumb:0},
            {big:false,title:'我',icon:'iconfont icon-account',path:'member',is_thumb:0},
          ]
        },
      },
    },
}

const model_list={

    //搜索栏
    search:{title:'搜索栏',img:'el-icon-search',type:'search',
    data:[
      {title:'是否显示按钮文字',field:'is_title',type:'switch'},
      {title:'是否显示消息',field:'button_left',type:'switch'},
      {title:'是否显示分享',field:'button_right',type:'switch'},
      {title:'消息图标',field:'font_msg',type:'classFont',nofloat:1},
      {title:'分享图标',field:'font_share',type:'classFont',},
      {title:'按钮文字颜色',field:'color',type:'color'},
      {title:'图标大小',field:'icon_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'按钮文字大小',field:'title_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'搜索栏圆角',field:'button_radius',type:'slider',min:0,max:50,nofloat:1},
    ],
    def:{type:'search',data:{ //搜索栏
        button_left:true,
        button_right:true,
        color:'#ffffff',
        title_size:8,
        icon_size:18,
        is_title:true,
        button_radius:50,
        font_msg:'iconfont icon-xinxi',
        font_share:'iconfont icon-gift',
      },},
    },
    //轮播/封面
    banner:{title:'轮播/封面',img:'el-icon-picture-outline',type:'banner',
    data:[
      {title:'图片高度',field:'img_height',type:'slider',min:50,max:240,nofloat:1},
      {title:'图片圆角',field:'img_radius',type:'slider',min:0,max:100,nofloat:1},
      {title:'设置图片',field:'banner',type:'banner',width:"100",height_field:"img_height",nofloat:1},
    ],
    def:{type:'banner',data:{
        img_height:130,//图片高度
        img_radius:10,
        banner:[{thumb:get_upload_url()+"wxmini/static/image/banner.jpg"}],
        padding_w:10,
        padding_h:10,
      },},
    },
    //导航栏
    nav:{title:'图标导航',img:'el-icon-position',type:'nav',
    data:[
      {title:'每行个数',field:'column',type:'select',list:['2个','3个','4个','5个'],},
      {title:'是否显示标题',field:'is_title',type:'switch'},
      {title:'图标大小',field:'nav_img_size',type:'slider',min:30,max:100,nofloat:1},
      {title:'图标圆角',field:'nav_radius',type:'slider',min:0,max:100,nofloat:1},
      {title:'标题文字大小',field:'title_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'图标文字距离',field:'nav_img_bottom',type:'slider',min:0,max:40,nofloat:1},
      {title:'图标行边距',field:'nav_top',type:'slider',min:0,max:100,nofloat:1},
      {title:'设置导航',field:'nav_list',type:'banner',width:"60",height:"60",nofloat:1,horn:1},
    ],
    def:{type:'nav',data:{
        margin_top:10,
        margin_w:10,
        padding_w:10,
        padding_h:10,
        radius:10,
        is_background:0,
        is_title:true,
        background:'#fff',
        column:2, //每列
        nav_img_size:50, //每个小导航图片的高
        nav_img_bottom:0, //每个小导航图片距离下方文字的距离              
        nav_radius:20,//每个小导航图片圆角的弧度
        title_size:14,//导航文字大小
        nav_top:5,//每个小导航距离上面边距
        
        //导航栏内容
        nav_list:[
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_04.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_06.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_08.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_10.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_17.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_20.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_22.png",title:'标题',horn:0},
            { thumb:get_upload_url()+"wxmini/static/image/zb_shouye_24.png",title:'标题',horn:0},
        ]
      },},
    },
    //秒杀团购多功能
    offer:{title:'秒杀团购多功能',img:'el-icon-magic-stick',type:'offer',
    data:[
      {title:'设置',field:'list',type:'offer',nofloat:1},
    ],
    def:{type:'offer',data:{
        list:[
          {status:true,name:'限时秒杀',title:'限时秒杀',},
          {status:true,name:'火爆团购',title:'火爆团购',button_color:'#f84ab3',subtitle:'有料有趣',subtitle_color:'#f84ab3'},
          {status:true,name:'商城新品',title:'商城新品',button_color:'#19c960',subtitle:'有料有趣',subtitle_color:'#19c960'},
          {status:true,name:'特价专区',title:'特价专区',button_color:'#4ab9f8',},
        ]
      },},
    },
    //橱窗
    activity:{title:'橱窗',img:'el-icon-date',type:'activity',
    data:[
      {title:'高度',field:'height',type:'slider',min:80,max:240,nofloat:1},
      {title:'图片内边距',field:'margin_thumb',type:'slider',min:0,max:10,nofloat:1},
      {title:'图片圆角',field:'img_radius',type:'slider',min:0,max:100,nofloat:1},
      {title:'使用橱窗排列',field:'is_display',type:'switch'},
      {title:'每行个数',field:'column',type:'select',list:['1个','2个','3个','4个']},
      {title:'展示图片',field:'list',type:'banner',width:"100",height_field:"height",height_field_column:"column",nofloat:1,},
    ],
    def:{type:'activity',data:{
        column:2,
        height:100,
        margin_thumb:0,
        img_radius:0,//商品外圆角
        is_display:true,//橱窗
        list:[
          {thumb:get_upload_url()+"wxmini/static/image/shangpin.jpg"},
          {thumb:get_upload_url()+"wxmini/static/image/shangpin.jpg"},
          {thumb:get_upload_url()+"wxmini/static/image/shangpin.jpg"},
          {thumb:get_upload_url()+"wxmini/static/image/shangpin.jpg"},
        ],
      },},
    },
    //公告
    notice:{title:'公告',img:'el-icon-lollipop',type:'notice',
    data:[
      {title:'图标大小',field:'thumb_size',type:'slider',min:0,max:100,nofloat:1},
      {title:'图标宽度',field:'left_width',type:'slider',min:0,max:100,nofloat:1},
      {title:'图标右边距',field:'left_img_right',type:'slider',min:0,max:100,nofloat:1},
      {title:'高度',field:'height',type:'slider',min:0,max:100,nofloat:1},
      {title:'公告文字大小',field:'right_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'公告图标',field:'thumb',type:'thumb',width:"60",height:"60",nofloat:1},
      {title:'公告内容',field:'list',type:'banner',width:"100",height:"60",no_thumb:1},
    ],
    def:{type:'notice',data:{
        thumb_size:20,//图片宽度
        thumb:get_upload_url()+"wxmini/static/live/notice.png",//图片地址
        height:25,//高度
        left_width:35,//左侧图片框
        left_img_border:'1px solid #f0f0f0',//左侧图片右边的边框
        left_img_right:5,//左侧图片右外边距
        right_size:14,//公告文字大小
        list:[
          {title:'热烈庆祝商城公告~',color:'#999999',}
        ],
        margin_top:4,
        margin_w:4,
        padding_w:4,
        padding_h:4,
        radius:4,
        is_background:0,
        background:'#ffffff',//渐变背景颜色
      },},
    },
    //商品列表
    commodities:{title:'商品列表',img:'el-icon-cherry',type:'commodities',
    data:[
      {title:'高度',field:'height',type:'slider',min:80,max:240,nofloat:1},
      {title:'上边距',field:'g_margin_top',type:'slider',min:0,max:100,nofloat:1},
      {title:'左右边距',field:'g_margin_w',type:'slider',min:0,max:5,nofloat:1},
      {title:'内边距',field:'g_padding',type:'slider',min:0,max:100,nofloat:1},
      {title:'圆角',field:'g_radius',type:'slider',min:0,max:100,nofloat:1},
      {title:'图片宽度',field:'g_img_width',type:'slider',min:0,max:100,nofloat:1},
      {title:'图片圆角',field:'g_img_radius',type:'slider',min:0,max:100,nofloat:1},
      {title:'是否双排显示',field:'inv',type:'switch'},
      {title:'背景颜色',field:'g_background',type:'color'},
      {title:'主标题颜色',field:'title_coloe',type:'color',nofloat:1},
      {title:'副标题颜色',field:'tags',type:'color'},
      {title:'商品价格颜色',field:'price_color',type:'color'},
      {title:'商品原价颜色',field:'price_yuan_color',type:'color'},

      {title:'购物车图标',field:'class_font',type:'classFont',condition:['inv',false],bottom_border:0},
      {title:'购物车图标颜色',field:'class_font_color',type:'color',condition:['inv',false]},
      {title:'购物车背景颜色',field:'icon_color',type:'color',condition:['inv',false]},
      {title:'购物车图标大小',field:'class_font_size',type:'slider',min:8,max:40,nofloat:1,condition:['inv',false]},
      {title:'购物车圆角',field:'icon_radius',type:'slider',min:0,max:40,nofloat:1,condition:['inv',false]},
      {title:'购物车背景大小',field:'icon_size',type:'slider',min:10,max:60,nofloat:1,condition:['inv',false],bottom_border:1},

      {title:'主标题文字大小',field:'title_fize',type:'slider',min:8,max:40,nofloat:1},
      {title:'副标题文字大小',field:'tags_fize',type:'slider',min:8,max:40,nofloat:1},
      {title:'商品价格文字大小',field:'price_fize',type:'slider',min:8,max:40,nofloat:1},
      {title:'商品原价文字大小',field:'price_yuan',type:'slider',min:8,max:40,nofloat:1},
      {title:'商品价格上边距',field:'price_top',type:'slider',min:0,max:100,nofloat:1},

      {title:'价格标签文字',field:'prefix_label',type:'input',bottom_border:0},
      {title:'标签文字颜色',field:'prefix_color',type:'color',},
      {title:'背景颜色',field:'prefix_bg',type:'color',},
      {title:'文字大小',field:'prefix_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'背景圆角',field:'prefix_radius',type:'slider',min:0,max:50,nofloat:1},

      {title:'设置边框',field:'g_is_border',type:'switch',nofloat:1,bottom_border:0},
      {title:'阴影颜色',field:'g_shadow_color',type:'color',condition:['g_is_border',true],},
      {title:'边框颜色',field:'g_border_color',type:'color',condition:['g_is_border',true],},
      {title:'阴影大小',field:'g_shadow_size',type:'slider',min:0,max:50,nofloat:1,condition:['g_is_border',true],},
      {title:'边框大小',field:'g_border_size',type:'slider',min:0,max:50,nofloat:1,condition:['g_is_border',true],bottom_border:1},
      {title:'数据来源',field:'sources',type:'select',list:['精选','推荐','新品','热卖','分类','自选'],tip:'前4个分别对应商品设置的4个状态'},
      {title:'显示数量',field:'sources_num',type:'slider',min:0,max:10,nofloat:1,tip:'选0为不限制,瀑布式翻页'},
      {title:'选择分类',field:'goods_cate',type:'goods_cate',condition:['sources',4]},
      {title:'选择商品',field:'goods_list',type:'goods_list',condition:['sources',5]},

    ],
    def:{type:'commodities',data:{
        inv:true,
        sources:0,
        sources_num:0,
        prefix_label:'',
        prefix_bg:'#474548',
        g_is_border:true,
        g_background:'#ffffff',//商品背景颜色
        g_padding:5,//商品背景内边距
        g_radius:5,//商品外圆角
        g_img_width:35,//商品图片宽
        height:120,//商品图片宽
        g_img_radius:5,//商品图片圆角
        g_margin_top:5,//商品外上边距
        g_margin_w:2,//商品外上边距
        title_coloe:'#333333',//商品标题颜色
        title_fize:14,//商品标题大小
        tags:'#999999',//副标题颜色
        class_font:'iconfont icon-cart-Empty',
        class_font_size:14,
        class_font_color:'#ffffff',
        icon_color:'#ff0000',
        icon_size:30,
        icon_radius:50,
        tags_fize:12,//副标题大小
        price_color:'#ff0000',//商品价格颜色
        price_fize:14,//商品价格大小
        price_yuan:12,//商品原价大小
        price_top:10,//商品价格上方距离
        price_yuan_color:'#999999',//商品原价颜色
        g_shadow_size:1,
        g_shadow_color:'rgba(166, 161, 161, 0.68)',
      },},
    },
    //主副标题
    maintitle:{title:'主副标题',img:'el-icon-lollipop',type:'maintitle',
    data:[
      {title:'左侧图标',field:'is_thumb',type:'switch'},
      {title:'图标',field:'thumb',type:'thumb',width:"60",height:"60",nofloat:1,condition:['is_thumb',true]},
      {title:'图标大小',field:'thumb_size',type:'slider',min:0,max:100,nofloat:1,condition:['is_thumb',true]},
      {title:'图标宽度',field:'left_width',type:'slider',min:0,max:100,nofloat:1,condition:['is_thumb',true]},
      {title:'高度',field:'height',type:'slider',min:0,max:100,nofloat:1},
      {title:'主标题左右边距',field:'left_img_right',type:'slider',min:0,max:100,nofloat:1},
      {title:'主标题内容',field:'title',type:'input',},
      {title:'主标题颜色',field:'title_color',type:'color'},
      {title:'主标题文字大小',field:'right_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'副标题内容',field:'v_title',type:'input',},
      {title:'副标题颜色',field:'v_title_color',type:'color'},
      {title:'副标题文字大小',field:'v_right_size',type:'slider',min:8,max:40,nofloat:1},
      {title:'右侧按钮',field:'is_button',type:'switch'},
      {title:'按钮文字大小',field:'b_right_size',type:'slider',min:8,max:40,nofloat:1,condition:['is_button',true]},
      {title:'按钮标题',field:'b_title',type:'input',condition:['is_button',true]},
      {title:'按钮文字颜色',field:'b_title_color',type:'color',condition:['is_button',true]},
      {title:'按钮图标颜色',field:'icon_color',type:'color',condition:['is_button',true]},
      {title:'按钮图标',field:'icon',type:'classFont',condition:['is_button',true]},
      {title:'按钮链接',field:'urlarr',type:'banner',is_url:1,condition:['is_button',true]},
      
    ],
    def:{type:'maintitle',data:{
        thumb_size:20,//图片宽度
        thumb:get_upload_url()+"wxmini/static/live/notice.png",//图片地址
        height:50,//高度
        is_thumb:false,
        urlarr:[{url:''}],
        is_button:true,
        title:'这里写主题',
        title_color:'#000000',
        v_title:'这里是副标题',
        v_title_color:'#999999',
        v_right_size:12,
        b_title:'查看更多',
        b_title_color:'#999999',
        b_right_size:12,
        icon_color:'#999999',
        icon:'iconfont icon-gouwuche1',
        left_width:20,//左侧图片框
        left_img_border:'1px solid #f0f0f0',//左侧图片右边的边框
        left_img_right:5,//左侧图片右外边距
        right_size:14,
        
        margin_top:0,
        margin_w:0,
        padding_w:0,
        padding_h:0,
        radius:0,
        is_background:0,
        background:'#ffffff',//渐变背景颜色
      },},
    },
  }

//公共属性
const appearance=[
    {title:'顶部外边距',field:'margin_top',type:'slider',min:0,max:160,nofloat:1},
    {title:'左右外边距',field:'margin_w',type:'slider',min:0,max:160,nofloat:1},
    {title:'左右内边距',field:'padding_w',type:'slider',min:0,max:100,nofloat:1},
    {title:'上下内边距',field:'padding_h',type:'slider',min:0,max:100,nofloat:1},
    {title:'边框圆角',field:'radius',type:'slider',min:0,max:100,nofloat:1},
    {title:'背景颜色或图片',field:'is_background',type:'select',list:['颜色','图片'],},
    {title:'背景颜色',field:'background',type:'color'},
    {title:'设置图片',field:'background_thumb',type:'thumb',condition:['is_background','1'],width:"100",height:"60"},
    {title:'设置边框',field:'is_border',type:'switch',nofloat:1},
    {title:'阴影颜色',field:'shadow_color',type:'color',condition:['is_border',true],},
    {title:'边框颜色',field:'border_color',type:'color',condition:['is_border',true],},
    {title:'阴影大小',field:'shadow_size',type:'slider',min:0,max:50,nofloat:1,condition:['is_border',true],},
    {title:'边框大小',field:'border_size',type:'slider',min:0,max:50,nofloat:1,condition:['is_border',true],},
]
  module.exports={model_list,model_hide_list,appearance}
